package com.crm.crm.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.crm.crm.domain.ChannelCount;
import com.crm.crm.domain.Contract;
import com.crm.crm.domain.dto.contract.ContractDto;
import com.crm.crm.domain.dto.contract.ContractPageQueryParams;
import com.crm.crm.domain.dto.contract.ContractSaveDTO;
import com.crm.crm.domain.dto.report.ContractStatisticsListDto;
import com.crm.crm.domain.vo.CountShipVo;
import com.crm.crm.domain.vo.contract.ContractReportResponse;
import com.crm.crm.domain.vo.contract.ContractVo;
import com.crm.crm.domain.vo.PageResult;
import com.crm.crm.domain.vo.SubjectCountVo;

import java.util.List;
import java.util.Map;

public interface ContractService{
    PageResult<Contract> pageQuery(ContractPageQueryParams pageQueryParams);

    /**
     * 新增合同
     * @param contractDto
     */
    void addContract(ContractDto contractDto);


    //这是统计客户时候调用的分页查询方法
    Page<Contract> list(ContractStatisticsListDto dto, Page<Contract> page);
    //    统计当前时间段类新增客户和累计客户数
    ContractReportResponse contractStatistics(String beginCreateTime, String endCreateTime);

    List<SubjectCountVo> countProject(String beginCreateTime, String endCreateTime);

    ContractVo getContractDetailsById(Long id);

    void updateContractById(ContractSaveDTO contractSaveDTO);

    /**
     * 商机转客户新增合同
     * @param id
     * @param contractDto
     */
    void changeContract(Long id, ContractDto contractDto);

    //统计客户的来源渠道
    List<Map<Integer, String>> CountChannel(String beginCreateTime, String endCreateTime);

//    统计客户的来源活动
    List<Map<String, Integer>> CountActivitystics(String beginCreateTime, String endCreateTime);
    //    统计所属人的分页查询
    List<CountShipVo> countOwner(String beginCreateTime, String endCreateTime);
    //    统计所属部门的分页查询
    List<CountShipVo> countDept(String beginCreateTime, String endCreateTime);
    //    统计所属渠道的分页查询
    List<CountShipVo> countChannel(String beginCreateTime, String endCreateTime);
    //    销售统计的曲线图，统计了每天的销售金额
    ContractReportResponse salesStatistics(String beginCreateTime, String endCreateTime);
}
